package org.budo.jedis.pool;

import lombok.Getter;
import lombok.Setter;
import redis.clients.jedis.JedisPool;
import redis.clients.jedis.JedisPoolConfig;

/**
 * @author lmw
 */
@Getter
@Setter
public abstract class AbstractBudoJedisPool extends JedisPool {
    private JedisPoolConfig jedisPoolConfig;

    private String host;

    private int port;

    private int timeout;

    private int database;

    public AbstractBudoJedisPool(JedisPoolConfig jedisPoolConfig, String host, int port, int timeout, String password, int database) {
        super(jedisPoolConfig, host, port, timeout, password, database);

        this.jedisPoolConfig = jedisPoolConfig;
        this.host = host;
        this.port = port;
        this.timeout = timeout;
        this.database = database;
    }

    @Override
    public String toString() {
        return super.toString() + "[jedisPoolConfig=" + this.jedisPoolConfig //
                + ", host=" + this.host //
                + ", port=" + this.port //
                + ", timeout=" + this.timeout //
                + ", database=" + this.database + "]";
    }
}